import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/monitor',
      name: 'Monitor',
      component: () => import('@/views/mokan/monitor.vue'),
    },
    {
      path: '/order',
      name: 'OrderManage',
      children: [
        {
          path: '/order/detail/:id',
          name: 'OrderDetail',
          component: () => import('@/views/order/index.vue'),
        },
      ],
    },
    {
      path: '/customer',
      name: 'CustomerManage',
      children: [
        {
          path: '/customer/acceptance/:id',
          name: 'CustomerAcceptance',
          component: () => import('@/views/customer/acceptance.vue'),
          meta: { title: '客户验收' },
        },
        {
          path: '/customer/execution/:id',
          name: 'CustomerExecution',
          component: () => import('@/views/customer/execution.vue'),
          meta: { title: '施工验收' },
        },
      ],
    },
    {
      path: '/statistic/:id',
      name: 'Statistic',
      component: () => import('@/views/statistic/index.vue'),
    },
  ],
})

export default router
